package bp.App.GZSZ.model;

import bp.da.DataType;
import bp.en.*;
import bp.port.Depts;
import bp.port.EmpAttr;
import bp.port.EmpSettings;

/** 
 操作员 的摘要说明。
*/
public class PM_NewCustomer extends EntityMyPK
{

	/**
	 操作员f
	*/
	public PM_NewCustomer()
	{
	}
	@Override
	public UAC getHisUAC()
	{
		UAC uac = new UAC();
		if (bp.web.WebUser.getIsAdmin() == true)
		{
			uac.OpenAll();
		}
		else
		{
			uac.Readonly();
		}
		uac.IsInsert = false;
		uac.IsDelete = false;
		return uac;
	}
	/** 
	 重写基类方法
	*/
	@Override
	public Map getEnMap() {
		if (this.get_enMap() != null)
		{
			return this.get_enMap();
		}

		Map map = new Map("lzmispm.dbo.PM_NewCustomer", "客户变更记录");
		map.setEnType(EnType.App);


			///#region 字段
		/*关于字段属性的增加 */
		map.AddTBStringPK(this.getPK(), null, "主键", false, false, 1, 500, 90);
		map.AddTBString(NewCustomerAttr.NC_ID, null, "NC_ID", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_Code, null, "客户编号", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_Unit, null, "单位名称", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_Address, null, "单位地址", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_Type, null, "客户类别", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_Province, null, "客户省份", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_FRName, null, "法人姓名", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_FRPhone, null, "法人电话", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_FJ, null, "附件", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_JBRSign, null, "经办人签名", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_FZRSign, null, "部门负责人", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_KZBSign, null, "市场拓展部", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.FIID, null, "变更流程ID", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_Title, null, "NC_Title", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.CR_ID, null, "客户ID", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_AddressNew, null, "新单位地址", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_TypeNew, null, "新客户类别", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_ProvinceNew, null, "新客户省份", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_FRNameNew, null, "新法人", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_FRPhoneNew, null, "新法人电话", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_UnitNew, null, "新单位名称", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_ISJTUnit, null, "是否为集团内单位", true, true, 0, 50, 100);
		map.AddTBString(NewCustomerAttr.NC_CRType, null, "客户属性", true, true, 0, 50, 100);
		map.AddTBDateTime(NewCustomerAttr.RDT, "", "创建日期", true, true);

		this.set_enMap(map);
		return this.get_enMap();
	}

	public final void setValByKey(String key, String value) throws Exception {
		this.SetValByKey(key, value);
	}

	@Override
	protected boolean beforeUpdateInsertAction() throws Exception
	{
		return super.beforeUpdateInsertAction();
	}

	@Override
	protected boolean beforeDelete() throws Exception
	{
			throw new RuntimeException("err@您不能删除变更记录");
	}
	/** 
	 获取集合
	*/
	@Override
	public Entities GetNewEntities()
	{
		return new EmpSettings();
	}

}
